/**
 ----------------------
 1.当前文件用于编辑表单
 2.提供表单相关属性
 3. @param xxxFormConfig.current 指向当前选中的数据
 ----------------------
 */
import type {SystemPost} from '@/api/modules/system/post/types';
import type {Rule} from 'ant-design-vue/es/form/interface';
import {useAxForm} from '@/utils/common/hooks';

const postFormObj: SystemPost = {
        postId: 0 ,
        postCode: "" ,
        postName: "" ,
        postSort: 0 ,
        status: "" ,
        createBy: "" ,
        createTime: null ,
        updateBy: "" ,
        updateTime: null ,
        remark: "" ,
        postDesc: "" ,
        commentId: 0 ,
};

// 表格校验
export const postRules: Record<string, Rule[]> = {
    postCode: [{required: true, trigger: 'change'}],
    postName: [{required: true, trigger: 'change'}],
    postSort: [{required: false , trigger: 'change'}],
    status: [{required: false , trigger: 'change'}],
    remark: [{required: false , trigger: 'change'}],
    postDesc: [{required: false , trigger: 'change'}],
    commentId: [{required: false , trigger: 'change'}],
};
export const postFormConfig = useAxForm<SystemPost>(postFormObj);
export const postFormRef = ref()